|
In relational algebra, a projection is a unary operation written as where is a set of attribute names. The result of such projection is defined as the set obtained when the components of the tuple are restricted to the set – it ''discards'' (or ''excludes'') the other attributes.〔(【引用サイトリンク】title=Relational Algebra )〕 In practical terms, it can be roughly thought of as picking a sub-set of all available columns. For example, if the attributes are (name, age), then projection of the relation onto attribute list (age) yields – we have discarded the names, and only know what ages are present. In addition, projection can be used to modify an attribute's value: if relation R has attributes a, b, and c, and b is a number, then will return a relation nearly the same as R, but with all values for 'b' shrunk by half.〔http://www.csee.umbc.edu/~pmundur/courses/CMSC661-02/rel-alg.pdf ''See Problem 3.8.B on page 3''〕 ==Related concepts== The closely related concept in set theory (see: projection (set theory)) differs from that of relational algebra in that, in set theory, one projects onto ordered components, not onto attributes. For instance, projecting onto the second component yields 7. Projection is relational algebra's counterpart of existential quantification in predicate logic. The attributes ''not'' included correspond to existentially quantified variables in the predicate whose extension the operand relation represents. The example below illustrates this point. Because of the correspondence with existential quantification, some authorities prefer to define projection in terms of the excluded attributes. In a computer language it is of course possible to provide notations for both, and that was done in ISBL and several languages that have taken their cue from ISBL. A nearly identical concept occurs in the category of monoids, called a string projection, which consists of removing all of the letters in the string that do not belong to a given alphabet. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Projection (relational algebra)」の詳細全文を読む スポンサード リンク
|